Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve examples so that they work for small MCUs (e.g. Arduino Uno). #123

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

haydenroche5
Copy link
Contributor

  • If NOTE_LOWMEM is defined, don't call notecard.setDebugOutputStream. This saves RAM by removing logging strings.
  • Don't use notecard.logDebug for application logging (i.e. logging in the .ino files).

@haydenroche5 haydenroche5 requested a review from zfields January 22, 2024 18:40
@haydenroche5 haydenroche5 self-assigned this Jan 22, 2024
@haydenroche5 haydenroche5 force-pushed the uno_example_improvements branch from 2fdb44b to 2443d9a Compare January 22, 2024 20:45
@@ -69,8 +69,14 @@ void setup()
const size_t usb_timeout_ms = 3000;
for (const size_t start_ms = millis(); !usbSerial && (millis() - start_ms) < usb_timeout_ms;)
;

// For low-memory platforms, don't turn on internal Notecard logs.
#ifndef NOTE_LOWMEM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now NOTE_C_LOW_MEM

@haydenroche5 haydenroche5 force-pushed the uno_example_improvements branch from 2443d9a to 09b5d31 Compare January 31, 2024 01:09
@haydenroche5
Copy link
Contributor Author

@zfields I added the [APP] tag for app logs, as we discussed.

@haydenroche5 haydenroche5 requested a review from zfields January 31, 2024 01:10
notecard.logDebug("INBOUND REQUEST: ");
notecard.logDebug(JGetString(body, INBOUND_QUEUE_COMMAND_FIELD));
notecard.logDebug("\n\n");
usbSerial.println("[APP] INBOUND REQUEST: ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/b usbSerial.print() instead of usbSerial.println()

- If NOTE_LOWMEM is defined, don't call notecard.setDebugOutputStream. This
saves RAM by removing logging strings.
- Don't use notecard.logDebug for application logging (i.e. logging in the .ino
files).
@haydenroche5 haydenroche5 force-pushed the uno_example_improvements branch from 09b5d31 to 78b4493 Compare January 31, 2024 16:20
@haydenroche5 haydenroche5 merged commit 79d96c7 into blues:master Jan 31, 2024
94 checks passed
@haydenroche5 haydenroche5 deleted the uno_example_improvements branch January 31, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants